Imports DotNetNuke.UI.Utilities
Imports DotNetNuke.UI.WebControls

Partial Class Samples_MenuCss
    Inherits System.Web.UI.Page

    Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
        MyBase.OnInit(e)
        DotNetNuke.UI.Utilities.ClientAPI.HandleClientAPICallbackEvent(Me)

    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If ClientAPI.IsInCallback(Me.Page) = False Then
            Dim oXML As System.Xml.XmlDocument = New System.Xml.XmlDocument
            oXML.Load(Server.MapPath(ResolveUrl("~/xml/FileMenu.xml")))
            Me.DNNMenu1.LoadXml(oXML.OuterXml)
            Me.DNNMenu2.LoadXml(oXML.OuterXml)
        End If
    End Sub

    Private Sub DNNMenu1_PopulateOnDemand(ByVal source As Object, ByVal e As DNNMenuEventArgs) Handles DNNMenu1.PopulateOnDemand
        AddPODNodes(e.Node)
    End Sub

    Private Sub DNNMenu2_PopulateOnDemand(ByVal source As Object, ByVal e As DNNMenuEventArgs) Handles DNNMenu2.PopulateOnDemand
        AddPODNodes(e.Node)
    End Sub

    Private Sub AddPODNodes(ByVal parent As DNNNode)
        Dim node As MenuNode = New MenuNode
        node.ID = "20"
        node.Text = "Copy (POD)"
        node.ClickAction = eClickAction.None
        parent.DNNNodes.Add(node)
        node = New MenuNode
        node.ID = "21"
        node.Text = "Paste (POD)"
        node.ClickAction = eClickAction.None
        parent.DNNNodes.Add(node)
    End Sub

End Class
